package com.zkthink.ceres.common.enums;

import com.zkthink.exception.BizException;
import lombok.Getter;

@Getter
public enum SourceTypeEnum {
    ZZZC_SOURCE(0, "自主注册"),
    HTTJ_MANAGER(1, "后台添加");
    private int code;

    private String desc;

    SourceTypeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static SourceTypeEnum getDscByType(Integer type) {
        for (SourceTypeEnum p : values()) {
            if (p.getCode() == type.intValue()) {
                return p;
            }
        }
        throw new BizException("no support promotionPlan");
    }
}
